//
//  ChangePayViewController.m
//  TenThousand
//
//  Created by 我的 on 16/7/5.
//  Copyright © 2016年 baixue. All rights reserved.
//

#import "ChangePayViewController.h"

@interface ChangePayViewController ()
@property (weak, nonatomic) IBOutlet UITextField *oldPayPossWord;
@property (weak, nonatomic) IBOutlet UITextField *payPassWord;
@property (weak, nonatomic) IBOutlet UITextField *erPassWord;
@property (weak, nonatomic) IBOutlet UIButton *surePay;

@property (weak, nonatomic) IBOutlet UIButton *agreeBtn;
@end

@implementation ChangePayViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"修改支付密码";
    [self createLeft:[UIImage imageNamed:@"ZHSZicon_03"] leftClick:^{
        [self.navigationController popViewControllerAnimated:YES];
    } right:nil rightClick:nil];
    
    self.agreeBtn.selected = YES;//默认为选中
  
}
- (IBAction)agreeBtn:(UIButton *)sender {
    
    if (sender.selected) {
        sender.selected = NO;
        _surePay.enabled = NO;
    }else{
        sender.selected = YES;
        _surePay.enabled = YES;
    }
}

- (IBAction)sureBtn:(id)sender {
    
//    URL:http://114.215.198.5:22853/User/EditPayment
    
    NSString *userId = [[NSUserDefaults standardUserDefaults]objectForKey:@"userId"];
    
    
    
    
    NSDictionary *para = @{@"Id":userId,@"OldPayment":_oldPayPossWord.text,@"Payment":_payPassWord.text};
    
//    [NetWorkManager requestWithType:HttpRequestTypePost withUrlString:@"User/EditPayment" withMethodName:@"EditPayment" withParaments:para withSuccessBlock:^(NSDictionary *object) {
//        
//        NSLog(@"%@",object[@"message"]);
//        [ToastView showInfoWithStatus:object[@"message"]];
//    } withFailureBlock:^(NSError *error) {
//        
//    } progress:nil];
    
    
}


@end
